package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.LeaveAbsenceDto;
import xyz.zhouzhaodong.crm.entity.LeaveAbsence;
import xyz.zhouzhaodong.crm.service.ILeaveAbsenceService;
import xyz.zhouzhaodong.crm.util.NoRepeatSubmit;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 请假 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-06-21
 */
@RestController
@RequestMapping("/leave-absence")
public class LeaveAbsenceController {

    @Resource
    ILeaveAbsenceService leaveAbsenceService;

    /**
     * 新增报销
     * @param leaveAbsence
     * @return
     */
    @NoRepeatSubmit
    @RequestMapping("/add")
    public RestMessage addLeaveAbsence(LeaveAbsence leaveAbsence){
        return leaveAbsenceService.addLeaveAbsence(leaveAbsence);
    }

    /**
     * 删除报销
     * @param leaveAbsence
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteLeaveAbsence(LeaveAbsence leaveAbsence){
        return leaveAbsenceService.deleteLeaveAbsence(leaveAbsence);
    }

    /**
     * 修改报销
     * @param leaveAbsence
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateLeaveAbsence(LeaveAbsence leaveAbsence){
        return leaveAbsenceService.updateLeaveAbsence(leaveAbsence);
    }

    /**
     * 查询报销
     * @param leaveAbsenceDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectLeaveAbsence(LeaveAbsenceDto leaveAbsenceDto){
        return leaveAbsenceService.selectLeaveAbsence(leaveAbsenceDto);
    }
    
}
